atunnel: broker actor certificates through atelet - #708
Conversation
|
Thanks Eitan Yarmush (@EItanya) ! Quick question before I review more deeply today. With the goal of "having a JWT available to atunnel to append on a CONNECT request to the egress" -- What parts of the this PR addresses? Here are the parts we needed (before this pr -- havent reviewed it yet);
From a very brief glance - I think your PR is attempting to do all three. Is that correct? Also, For (1), we likely need to sort out two things to make the JWTs useful:
See for ref - substrate/cmd/ateapi/internal/actoridentity/actoridentity.go Lines 135 to 138 in 3ed6aa0 |
|
Yes, with two clarifications: this PR renews JWTs, not actor certificates, and each worker has only one active actor.
I agree the issuer and subject contracts remain unresolved. This PR intentionally retains the existing issuer/subject behavior and does not implement PEP verification yet. Before verification lands, we need a stable OIDC issuer with discovery/JWKS reachable by the PEP. |
3306005 to
facebf3
Compare
| // TODO: Before release, request an atunnel-specific MintCert purpose and | ||
| // require the egress PEP to reject generic actor certificates. | ||
| // The request deliberately carries no actor identity. The authenticated Pod | ||
| // UID is the only input used to select a worker and its current assignment. | ||
| workerUID, err := authenticatedWorkerUID(ctx) |
There was a problem hiding this comment.
not sure I am following the TODO comment. I thought we were saying that we need it to be an actor cert thats specifically for atunnel use.
There was a problem hiding this comment.
I think it would be fine to merge without that, and then add it in a follow up? Either way works.
There was a problem hiding this comment.
Done. MintCert now requires the ATUNNEL purpose, embeds it in the ActorIdentity certificate extension, and atunnel verifies it before installing the certificate. PEP-side purpose enforcement remains a before-release follow-up.
There was a problem hiding this comment.
[needs issue] Eitan Yarmush (@EItanya) do we need an issue for that?
There was a problem hiding this comment.
I can create one, but really this should just go straight into your PR
| // TODO: Before release, request an atunnel-specific MintCert purpose and | ||
| // require the egress PEP to reject generic actor certificates. | ||
| // The request deliberately carries no actor identity. The authenticated Pod | ||
| // UID is the only input used to select a worker and its current assignment. | ||
| workerUID, err := authenticatedWorkerUID(ctx) |
There was a problem hiding this comment.
I think it would be fine to merge without that, and then add it in a follow up? Either way works.
| serverboot.Fatal(ctx, "Failed to load atelet Pod identity", fmt.Errorf("credential bundle has no Pod identity")) | ||
| } | ||
| brokerTLS := tlsCfg.Clone() | ||
| brokerTLS.VerifyConnection = restrictClientToNode(ateletIdentity) |
There was a problem hiding this comment.
I think over a UDS we should be able to get this level of control just from filesystem permissions? Ie, we create a UDS socket file for each individual ateom, and make sure only that ateom can access it.
TLS over a UDS is a bit strange.
There was a problem hiding this comment.
Sure, we can do that. To get the same isolation from filesystem permissions, though, we would need a separate broker hostPath, mount only each worker’s own socket directory into its ateom, and manage one listener per worker. The current hostPath is shared by all root-running ateoms, so 0600 on a per-worker filename alone would not isolate them.
mTLS gives us the same worker-to-atelet binding with considerably less change in the current layout. Would you be okay with keeping mTLS here?
There was a problem hiding this comment.
[needs issue] lets open an for that
960bb6d to
03aac19
Compare
|
Correction to my earlier summary: this PR has been retooled from bearer JWTs to purpose-scoped actor certificates. Atunnel generates and retains a per-activation private key, sends only a CSR to the node-local atelet, and atelet asks ateapi to mint an ATUNNEL-purpose actor certificate after revalidating the exact worker assignment. Atunnel renews that certificate in memory; no actor JWT is transported, so JWT issuer/subject work is no longer in scope here. PEP-side purpose enforcement remains a before-release follow-up. |
|
LGTM for the certificate bits. |
Bowei Du (bowei)
left a comment
There was a problem hiding this comment.
look ok. I think we might want to clean up some of the API comments + make sure optional vs required is what we want.
|
LGTM Eitan Yarmush (@EItanya) please open the issues here (added [needs issue] tag) Also we want to remove the egressgatewayadress flag and replace it with a proper proto on the actor. |
dc595ac to
12511d4
Compare
12511d4 to
a5caf21
Compare
c9777b4
into
agent-substrate:main
Closes #706
Summary
Testing
make verifygo test -race ./internal/atunnel